import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:hzy_normal_tool/hzy_normal_tool.dart';

import '../../common/index.dart';
import '../../tools/index.dart';
import '../vm/index.dart';
import '../widgets/index.dart';

class EgGetxDetailV extends BaseGetXV<EgGetxDetailVC> {
  EgGetxDetailV({super.key});
  @override
  EgGetxDetailVC get controller => Get.put(EgGetxDetailVC());

  @override
  Widget createBody({
    required BuildContext context,
    BoxConstraints? constraints,
  }) {
    Widget body = EgDetailWidget(
      imageList: controller.vm.imageList,
    );
    return body;
  }
}

class EgGetxDetailVC extends BaseGetXController {
  // --------- 公开属性  --------- //

  @override
  Color? get scallBackGroundColor => Colors.black;
  // --------- 私有属性  --------- //
  DetailVm vm = DetailVm();
  // --------- 生命周期  --------- //

  @override
  configDefault() {
    getNetWorkData();
  }

  // --------- 数据处理  --------- //
  @override
  getNetWorkData({int? type, Map<String, dynamic>? info}) async {
    pageState.value = PageState.initializedState;
    vm.configDetailImageModelList(
      tuChongItem: currentGetArguments(),
      width: SystemScreen.getScreenWidth(Get.context!),
    );
    pageState.value = PageState.dataFetchState;
  }
  // --------- 触发事件  --------- //
}
